package test;

import java.util.Arrays;


/**
 * @ClassName Demo
 * @Description  测试排序算法
 * @Author ZJX
 * @Date 2024/7/31 9:17
 * @Version 1.0
 */
public class Demo {
    public static void main(String[] args) {
        int[] arr = {12, 11, 13, 5, 6, 7,12,1,11,18};
        Sort sort = new Sort();
        sort.heapSort(arr);
        System.out.println("堆排序后的数组是:");
        System.out.println(Arrays.toString(arr));

        int[] arr1= {12, 11, 13, 5, 6, 7,12,1,11,18};
        sort.bubbleSort(arr1);
        System.out.println("冒泡排序后的结果: ");
        sort.printArray(arr1);

        System.out.println("插入排序排序过程(类似于抓扑克): ");
        int[] arr2 = {12, 11, 13, 5, 6, 7,12,1,11,18};
        sort.insertionSort(arr2);

        int[] arr3 = {5, 7, 1, 3, 2, 6, 4};
        System.out.println("排序前:");
        System.out.println(Arrays.toString(arr3));

        sort.shellSort(arr3);

        System.out.println("排序后:");
        System.out.println(Arrays.toString(arr3));
    }
}
